<?php
/**
* Add a transaction manualy
*
* @author       Fabrice Douteaud <admin@clearbudget.net>
* @package      snippets
* @access       public
*/

/***********************************************************************

  Copyright (C) 2008  Fabrice Douteaud (admin@clearbudget.net)

    This file is part of ClearBudget.

    ClearBudget is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ClearBudget is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ClearBudget.  If not, see <http://www.gnu.org/licenses/>.


************************************************************************/
//prevent direct access
if(!defined('ENGINEON')) die('Direct access forbidden');
?>
<script type="text/javascript">
	$(function() {
	  $.datepicker.setDefaults($.extend({showMonthAfterYear: false}, $.datepicker.regional['<?php echo $lang;?>']));
		$("#datepicker").datepicker({dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'style/icons/calendar.gif', buttonImageOnly: true});
	});
	</script>
<div class="tableDiv">
<table class="tableReport">
<caption><?php echo $keys->tableTitle_AddManualTransaction; ?></caption>
<tr><td colspan="4"><div class="hidden" id="resultDiv"></div></td></tr>
<tr>
  <td style="width:170px;vertical-align: text-top">Date<br/><div id="datepicker"></div></td>
  <td style="width:330px;vertical-align: text-top">
    <?php echo $keys->text_amountLong;?><br/><?php echo class_currency::getCurrencySymbol();?><input type="text" id="trnAmount" size="11"/>
    <?php echo $keys->text_Credit;?><input class="commentEntry" type="radio" name="trnDebit" id="trnDebit" value="0">
    <?php echo $keys->text_Debit;?><input class="commentEntry" type="radio" name="trnDebit" id="trnDebit" checked value="1"><br/>
    <?php echo $keys->text_commentsLong;?><br/><input class="commentEntry" type="text" size="50" id="trnComment" value=""><br/>
    <?php echo $keys->text_memo;?><br/><input class="commentEntry" type="text" size="50" id="trnMemo" value=""><br/>
    <br/>
  </td>
  <td style="width:250px;vertical-align: text-top">Category<br/>
    <select size=12 id="trnCategory" class="categorySelector" style="width:240px;"">
<?php  foreach($categories as $categoryId) {
    echo '<option value="'.$categoryId.'"';
    if($categoryId == 1) echo 'selected';
    echo '>'.$report->getCategoryName($categoryId).'</option>';
    }
?>
    </select>
  </td>
  <td style="width:70px">
  <span class="hidden" id="loadingSpan"><img  src="style/icons/icon_Loading.gif"></span>
  <span id="submitSpan">
    <a href="#" addManualTransaction="true"><img src="style/icons/disk.png"/>&nbsp;<?php echo $keys->link_save; ?></a><br/>
    <a href="#" action="addTransactionsManualy" toDiv="<?php echo $toDiv; ?>"><img src="style/icons/application_lightning.png"/>&nbsp;<?php echo $keys->link_cleanForm; ?></a>
    </span>
  </td>
</tr>
</table>
</div>
<br/>